package com.geor.gcv.core.ui;

import java.awt.Image;
import java.util.List;
import java.util.Observable;

import org.opencv.core.Mat;

import com.geor.gcv.core.mat.ProcessImage;

/**
 * 面板观察者
 * @author geor.lusongnan
 */
public class PanelObservable extends Observable {

	private Image images[] = null;
	private ProcessImage opencv;
	
	public PanelObservable() {

	}

	public PanelObservable(ProcessImage opencv) {
		super();
		this.opencv = opencv;
	}

	public void changeParams() {
		setChanged();
		notifyObservers(this);
	}

	public void setParams(String path) throws Exception {
		if (opencv != null) {
			images = opencv.deal(path);
		}
		changeParams();
	}
	
	public void setParams(List<Mat> mats) throws Exception {
		if (opencv != null) {
			images = opencv.deal(mats);
		}
		changeParams();
	}

	public Image[] getImage() {
		return images;
	}

}
